package com.qf.exhandler;

import com.qf.entity.Result;
import org.apache.shiro.authz.UnauthenticatedException;
import org.apache.shiro.authz.UnauthorizedException;
import org.apache.shiro.realm.Realm;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestController;

@ControllerAdvice
public class ExceptionHandlerAdvice  {
    @ExceptionHandler({
            UnauthorizedException.class
    })
    public Result handlerUnauthorizedException(UnauthorizedException e){
        return new Result(1,"您没有权限访问此功能，请联系管理员");
    }
}
